package com.lancoo.ccas53.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lancoo.ccas53.entity.Teacher;
import com.lancoo.ccas53.entity.TeachingClass;
import com.lancoo.ccas53.entity.TeachingClassTeacher;
import com.lancoo.ccas53.entity.TeachingClassWeek;
import com.lancoo.ccas53.pojo.common.PageInfo;
import com.lancoo.ccas53.pojo.dto.ResultDto;
import com.lancoo.ccas53.pojo.dto.TeachingClassWeekScheduleDto;
import com.lancoo.ccas53.pojo.vo.SubGroupVo;
import com.lancoo.ccas53.pojo.vo.TeachingClassHourVo;
import com.lancoo.ccas53.pojo.vo.TeachingClassVo;

import java.util.List;

/**
 * <p>
 * 教学班 服务类
 * </p>
 *
 * @author quin.song
 * @since 2024-05-20
 */
public interface TeachingClassService extends IService<TeachingClass> {


    /**
     * 批量删除教学班相关数据
     *
     * @param teachingClassIds
     */
    Integer deleteClass(List<Long> teachingClassIds);


    /**
     * 获取本学期该课程的教学班数量
     *
     * @param courseId
     * @return
     */
    Long getTeachingClassNumByCourseId(Long courseId);

    /**
     * 根据课程获取教学班
     *
     * @param courseId
     * @return
     */
    List<TeachingClassVo> getTeachingClassByCourseId(Long courseId);

    /**
     * 根据分班标识获取教学班
     *
     * @param uniqueShiftSign
     * @return
     */
    List<TeachingClass> getByUniqueShiftSign(String uniqueShiftSign);

    /**
     * 获取上课组列表
     *
     * @param taskId
     * @param uniqueShiftSign
     * @return
     */
    List<SubGroupVo> getClassGroupList(Integer taskId, String uniqueShiftSign);

    /**
     * 批量合班，合并教学班
     *
     * @param teachingClassIds
     * @return
     */
    Boolean combinedClass(List<Long> teachingClassIds, Long teachingClassId);

    /**
     * 获取非分组教学班列表，一个授课类型一条记录
     *
     * @param taskId
     * @param flag
     * @param campusId
     * @param collegeId
     * @param gradeId
     * @param baseMajorId
     * @param keyWord
     * @param teacherId
     * @return
     */
    ResultDto<TeachingClass> getTeachingClassHourList(Integer currentPage, Integer pageSize, Integer taskId, Integer flag, Integer campusId, String collegeId, String gradeId, String baseMajorId, String keyWord, Long teacherId);

    /**
     * @param page
     * @param taskId
     * @param flag
     * @param campusId
     * @param collegeId
     * @param gradeId
     * @param baseMajorId
     * @param keyWord
     * @param teacherId
     * @return
     */
    PageInfo<TeachingClassHourVo> getTeachingClassHourList(Page<TeachingClassHourVo> page, Integer taskId, Integer flag, Integer campusId, String collegeId, String gradeId, String baseMajorId, String keyWord, Long teacherId);

    /**
     * 统计教学任务
     *
     * @param taskId
     * @return
     */
    Object publishStatistics(Integer taskId);

    /**
     * 批量添加教学班
     *
     * @param taskId
     * @param teachingClassList
     * @return
     */
    List<TeachingClass> addBatchTeachingClass(Integer taskId, List<TeachingClass> teachingClassList);

    /**
     * 按行政班生成教学班
     *
     * @param planIds
     * @return
     */
    List<TeachingClass> addTeachingClassByClassId(Integer taskId, Long courseId, Integer teachingClassType, List<Integer> planIds);

    /**
     * 分不同教师上课，拆教学班
     *
     * @param taskId
     * @param teachingClassId
     * @return
     */
    List<TeachingClass> spiltClassForTeacher(Integer taskId, Long teachingClassId, Long splitNum, Integer hourType, List<Teacher> teacherList);

    /**
     * 确认发布-教学计划
     *
     * @param baseCollegeIdList
     * @param userId
     * @param userName
     * @param taskId
     * @return
     */
    Boolean confirmTeachTask(List<String> baseCollegeIdList, String userId, String userName, Integer taskId);

    /**
     * 更新教学班教师
     *
     * @param teachingClassId
     * @param hourType
     * @param teacherList
     * @return
     */
    List<TeachingClassTeacher> updateTeacher(Integer taskId, Long teachingClassId, Integer hourType, List<Teacher> teacherList, Integer type, Integer identity);

    List<TeachingClassWeekScheduleDto> getTeachingClassAllSchedule(Integer taskId, List<TeachingClassWeekScheduleDto> teachingClassTeachers, String timeCodes);

    String allTeachingClassToExcel(Integer taskId, String importMode, Integer type);


    List<TeachingClassWeek> setTeachingClassWeek(Integer taskId, List<TeachingClassWeek> teachingClassWeeks);
}
